<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>语音合成</title>
    <link rel="stylesheet" type="text/css" href="../static/css/audio_merge.css">
    <script type="text/javascript" src="../static/js/jquery-3.5.1.js"></script>
    <script type="text/javascript" src="../static/js/audio.js"></script>
</head>
<body>
<div class="box">



    <div class="head">
        <p>短文本语言合成</p>
        <a href="../index.html" onclick="nl()" id="a5">⇱ </a>
    </div>
    <!--  用户输入  -->
    <textarea class="text" placeholder="请输入..."></textarea>

    <div>
        <p id="pt">普通发音人选择：</p>
        <select id="ptp">
        <option value="0">度小美</option>
        <option value="1">度小宇</option>
        <option value="3">度逍遥</option>
        <option value="4">度丫丫</option>
    </select>
    </div>

    <div>
        <p id="pt2">精品发音人选择：</p>
        <select id="ptp2">
            <option value="5003">度逍遥（精品）</option>
            <option value="5118">度小鹿</option>
            <option value="106">度博文</option>
            <option value="110">度小童</option>
            <option value="111">度小萌</option>
            <option value="103">度米朵</option>
            <option value="5">度小娇</option>
        </select>
    </div>


    <div class="input">

        <p>语言合成配置:</p>
        <div class="option">
            <div>
                <span>语速:</span>
                <input id="input" type="range" class="spd" max="9" min="0" value="5" onchange="change(1)">
                <a id="spd_show">5</a>
            </div>
            <div>
                <span>音调:</span>
                <input  id="input2" type="range" class="pit" max="9" min="0" value="5" onchange="change(2)">
                <a id="pit_show">5</a>
            </div>
            <div>
                <span>音量:</span>
                <input id="input3" type="range" class="vol" max="9" min="0" value="5" onchange="change(3)">
                <a id="vol_show">5</a>
            </div>
        </div>
        <button type="submit" class="btn">开始</button>
    </div>

    <!--  结果展示  -->
    <div class="play">
        <audio  id="audio"  ref="audio" controls="controls"></audio>
    </div>
    <script>

        function change(index) {
            //     var spd = document.getElementById("input").value;
            //     document.getElementById("spd_show").innerHTML = spd;
            // }
            // function change2() {
            //     var spd = document.getElementById("input2").value;
            //     document.getElementById("pit_show").innerHTML = spd;
            // }
            // function change3() {
            //     var spd = document.getElementById("input3").value;
            //     document.getElementById("vol_show").innerHTML = spd;
            // }


            if (index == 1) {
                var spd = document.getElementById("input").value;
                document.getElementById("spd_show").innerHTML = spd;
            } else if (index == 2) {
                var spd = document.getElementById("input2").value;
                document.getElementById("pit_show").innerHTML = spd;
            } else if (index == 3) {
                var spd = document.getElementById("input3").value;
                document.getElementById("vol_show").innerHTML = spd;
            }
        }


    </script>
</div>
</body>
</html>